import React, { Component } from 'react';
import List from "./components/List"
import {getList} from "./api/index"

class App extends Component {
  state={
    list:[]
  }
  componentDidMount(){
    this.getAndSet()
  }
  async getAndSet(){
    const resp=await getList()
    this.setState({
      list:resp.data.data
    })
  }
  render() {
    const {list}=this.state
    return (
      <div>
        <List list={list}></List>
      </div>
    );
  }
}

export default App;